package com.tony.mindwarning.service.impl;

import com.tony.mindwarning.mpper.TypeMapper;
import com.tony.mindwarning.pojo.Type;
import com.tony.mindwarning.service.TypeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 *
 * @Title: TypeServiceImpl
 * @Auther: 皮蛋布丁
 * @Date: 2021/04/08/10:11
 * @Description:
 */
@Service
public class TypeServiceImpl implements TypeService {

    @Resource
    TypeMapper typeMapper;

    @Override
    public Integer addType(Type type,int userId) {
        return typeMapper.addType(type,userId);
    }

    @Override
    public Integer getTotalCount() {
        return typeMapper.getTotalCount();
    }

    @Override
    public List<Type> getTypesByPage(Map<String, Object> map) {
        return typeMapper.getTypesByPage(map);
    }

    @Override
    public Integer deleteType(int tid,int userId) {
        return typeMapper.deleteType(tid,userId);
    }

    @Override
    public Type getTypeById(int id) {
        return typeMapper.getTypeById(id);
    }

    @Override
    public int updateType(Type type,int userId) {
        return typeMapper.updateType(type,userId);
    }

    @Override
    public List<Type> getTypes() {
        return typeMapper.getTypes();
    }

    @Override
    public Integer compareTname(String tname) {
        return typeMapper.compareTname(tname);
    }
}
